package com.paschino.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.paschino.dao.ImageDAO;
import com.paschino.modal.Album;
import com.paschino.modal.StoreImage;

@Service
@Transactional
public class ImageServiceImpl implements ImageService {

	@Autowired
	private ImageDAO imageDAO;

	@Override
	public boolean addImage(StoreImage image) {
		return imageDAO.addImage(image);
	}
	
	@Override
	public List<StoreImage> getListImage(){
		return imageDAO.getListImage();
	}
	
	@Override
	public StoreImage getImage(int imageId){
		return imageDAO.getImage(imageId);
		
	}
	
	@Override
	public boolean updateImage(StoreImage image){
		return imageDAO.updateImage(image);
	}

	@Override
	public List<StoreImage> getListImageByAlbumID(Album album){
		return imageDAO.getListImageByAlbumID(album);
	}
	
	@Override
	public StoreImage getImageByGroupBy(String name, String type){
		return imageDAO.getImageByGroupBy(name, type);
	}
	
	@Override
	public List<StoreImage> getListImageByIsShow(Album album){
		return imageDAO.getListImageByIsShow(album);
	}
	
	@Override
	public int deleteImage(int imageID){
		return imageDAO.deleteImage(imageID);
	}

	@Override
	public int hideImage(int imageID){
		return imageDAO.hideImage(imageID);
	}
	
	@Override
	public int unhideImage(int imageID){
		return imageDAO.unhideImage(imageID);
	}
}
